# Function to create type weights based on parameters
create_type_weights <- function(voter_type, uniform_abstention, abstention_rate){
  
  weights <- uniform_abstention
  if(voter_type=="Uniform"){
    # Update type_weight vector based on abstention_ratio and abstention_rate
    weights[1] <- weights[1] * (1-abstention_rate)
    weights[2] <- weights[2] * (1-abstention_rate)
    weights[3] <- weights[3] * abstention_rate
    weights[4] <- weights[4] * abstention_rate
  }
  if(voter_type=="Type1"){
    weights[1] <- weights[1] * (1-abstention_rate)
    weights[2] <- weights[2] * 1
    weights[3] <- weights[3] * abstention_rate
    weights[4] <- weights[4] * 0
  }
  if(voter_type=="Type2"){
    weights[1] <- weights[1] * 1
    weights[2] <- weights[2] * (1-abstention_rate)
    weights[3] <- weights[3] * 0
    weights[4] <- weights[4] * abstention_rate
  }
  return(weights)
}